Benjamin Otte [Wed, 15 Sep 2021 05:37:57 +0000 (07:37 +0200)]
testuite: Add opacity-overdraw test
Tests that overdrawing of content inside an opacity node happens before
the opacity is applied.
This is broken in the GL renderer and causes the opacity.ui reftest to
fail.
Matthias Clasen [Wed, 15 Sep 2021 12:26:54 +0000 (08:26 -0400)]
ngl: Fix opacity handling
We need to use an offscreen whenever there is overlapping
children somewhere in the tree below, just checking the
direct child of the opacity node is not enough.
Fixes: #4261
Benjamin Otte [Wed, 15 Sep 2021 04:55:25 +0000 (06:55 +0200)]
reftests: Use GdkTexture instead of cairo_surface_t
This also switches the rendering code from using gsk_render_node_draw()
to gsk_renderer_render_texture().
Some tests are broken with the GL renderer, so this patch forces the
Cairo renderer until they get fixed.
Benjamin Otte [Wed, 15 Sep 2021 14:39:09 +0000 (16:39 +0200)]
reftests: Make diff pixels always opaque
We had pixels that did not differ in alpha and we then set 0 alpha
difference hich made the pixel invisible. Oops.
Benjamin Otte [Wed, 15 Sep 2021 04:53:15 +0000 (06:53 +0200)]
testsuite: remove box-order test
The test used to test that GtkBox ordered it's children left-to-right in
CSS, no matter the text direction or pack-type.
But there is neither a pack-type anymore nor does GTK4 do that.
So that test has been broken for yers, it just didn't render anything
wrong.
Benjamin Otte [Wed, 15 Sep 2021 20:08:33 +0000 (22:08 +0200)]
API: Add gdk_texture_new_from_filename()
There are quite a few places where we can make use of it, in particular
in the testsuite and icontheme.
Benjamin Otte [Thu, 16 Sep 2021 21:56:41 +0000 (23:56 +0200)]
testsuite: Fix race in texture-threads test
Threads are evil, yo.
Benjamin Otte [Thu, 16 Sep 2021 21:30:37 +0000 (23:30 +0200)]
gltexture: Fallback in download_float()
GLES only allows downloading float if the texture matches specific
criteria and I'm too lazy to determine them, so always fall back.
And the custom stride fallback code isn't necessary, because falling
back does exactly that step already.
Benjamin Otte [Thu, 16 Sep 2021 21:14:59 +0000 (23:14 +0200)]
gltexture: Fix download() for GLES
GLES can't do glGetTexImage(), so implement a version that does
glReadPixels() on GLES.
Benjamin Otte [Thu, 16 Sep 2021 19:49:50 +0000 (21:49 +0200)]
testsuite: Be more verbose in texture-threads test
The test randomly fails on CI, so try to be more helpful in debugging
them.
Matthias Clasen [Thu, 16 Sep 2021 18:32:23 +0000 (18:32 +0000)]
Merge branch 'master' into 'master'
Do not require wayland-protocols as dependency in the .pc files
See merge request GNOME/gtk!3960
muradm [Thu, 16 Sep 2021 14:53:00 +0000 (17:53 +0300)]
Do not require wayland-protocols as dependency in the .pc file
Basically, I was building some packages on Guix. I figured out that
wayland-protocols was listed among propagated-inputs for gtk+ package
(gtk-3-24). propagated-inputs holds a list of runtime dependencies,
that should be available to any other package that depends on gtk+.
While discussing we clarified that wayland-protocols is not runtime
dependency. So I moved it to native-inputs of gtk+ package, which
means that, this dependency will be available only to gtk+ package and
only at build time. Once moved, building of other applications that
depening on gtk+ started to fail.
Investigation showed that, all .pc (pkg-config) files prepared by gtk+
package, was including:
Requires.private: ... wayland-protocols ...
Since it becomes requirement, other applications was failing with
missing dependency wayland-protocols of dependency gtk+, for instance:
-- Checking for module 'gtk+-3.0'
-- Package 'wayland-protocols', required by 'gdk-3.0', not found
While actually wayland-protocols is not even a build time dependency
of application that depends on gtk+. Advertisement of such
requirement, is a bit misleading, because one does not need it at
runtime, especially applications based on gtk.
Matthias Clasen [Thu, 16 Sep 2021 11:35:35 +0000 (11:35 +0000)]
Merge branch 'wip/jimmac/make-toolbar-togglebuttons-visible' into 'master'
theme: make toggled tbuttons in toolbars visible
Closes #4264
See merge request GNOME/gtk!3959
Jakub Steiner [Thu, 16 Sep 2021 10:47:26 +0000 (12:47 +0200)]
theme: make toggled tbuttons in toolbars visible
- do what Alex does in libadwaita
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4264
Matthias Clasen [Thu, 16 Sep 2021 03:14:12 +0000 (03:14 +0000)]
Merge branch 'misc-texture-things' into 'master'
Add gdk_texture_new_from_bytes
See merge request GNOME/gtk!3958
Benjamin Otte [Tue, 14 Sep 2021 16:17:44 +0000 (18:17 +0200)]
pixbufutils: Simplify function
Matthias Clasen [Tue, 14 Sep 2021 12:38:25 +0000 (08:38 -0400)]
texture: Mention download_float in the docs
Matthias Clasen [Mon, 13 Sep 2021 17:30:12 +0000 (13:30 -0400)]
Add gdk_texture_new_from_bytes
Add this new api, and make gdk_texture_new_from_file
a wrapper around it.
Matthias Clasen [Thu, 16 Sep 2021 01:56:39 +0000 (01:56 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Fix memorytexture float conversion
See merge request GNOME/gtk!3957
Matthias Clasen [Tue, 14 Sep 2021 21:59:26 +0000 (17:59 -0400)]
ngl: Avoid cairo_to_png in debug output
Just use a GL texture and gdk_texture_save_to_png,
it was made for this.
Matthias Clasen [Wed, 15 Sep 2021 04:27:32 +0000 (00:27 -0400)]
Fix memorytexture float conversion
This was silently dropping the alpha in one case.
Matthias Clasen [Wed, 15 Sep 2021 23:25:57 +0000 (23:25 +0000)]
Merge branch 'update-readme' into 'master'
Update the README
See merge request GNOME/gtk!3956
Matthias Clasen [Wed, 15 Sep 2021 21:50:36 +0000 (21:50 +0000)]
Apply 1 suggestion(s) to 1 file(s)
Matthias Clasen [Wed, 15 Sep 2021 19:08:13 +0000 (15:08 -0400)]
Update the README
Remove the mention of GNU (since that has not been case
for a long time, effectively), state that GTK is hosted
by the GNOME project, and point to GNOME as a place
for donations.
Boyuan Yang [Wed, 15 Sep 2021 18:41:06 +0000 (18:41 +0000)]
Update Chinese (China) translation
Dz Chen [Wed, 15 Sep 2021 15:28:39 +0000 (15:28 +0000)]
Update Chinese (China) translation
Matthias Clasen [Tue, 14 Sep 2021 21:39:48 +0000 (21:39 +0000)]
Merge branch 'function-annotations' into 'master'
Annotate gsk_rounded_rect_is_circular as pure
See merge request GNOME/gtk!3952
Matthias Clasen [Tue, 14 Sep 2021 17:14:44 +0000 (13:14 -0400)]
Annotate gtk_get_default_language as const
Matthias Clasen [Tue, 14 Sep 2021 17:14:31 +0000 (13:14 -0400)]
Annotate gtk_editable_get_chars as malloc
Matthias Clasen [Tue, 14 Sep 2021 17:13:18 +0000 (13:13 -0400)]
csstypes: Add annotations and inlines
Inline _gtk_css_change_for_sibling and
_gtk_css_change_for_child, and mark a few
other functions as const or malloc.
Matthias Clasen [Tue, 14 Sep 2021 17:12:54 +0000 (13:12 -0400)]
Annotate some builder apis as malloc
Matthias Clasen [Tue, 14 Sep 2021 17:12:41 +0000 (13:12 -0400)]
Annotate gtk_accelerator_get_default_mod_mask as const
Matthias Clasen [Tue, 14 Sep 2021 17:11:42 +0000 (13:11 -0400)]
Annotate gsk_cairo_blur_compute_pixels as const
Matthias Clasen [Tue, 14 Sep 2021 17:11:20 +0000 (13:11 -0400)]
Annotate gdk_rgba_to_string as malloc
Matthias Clasen [Tue, 14 Sep 2021 17:10:48 +0000 (13:10 -0400)]
Annotate gdk_drag_action_is_unique as const
Matthias Clasen [Tue, 14 Sep 2021 16:23:37 +0000 (12:23 -0400)]
Annotate gtk_css_tokenizer_get_location as const
Matthias Clasen [Tue, 14 Sep 2021 16:23:07 +0000 (12:23 -0400)]
cssparser: Mark some functions as pure and malloc
Matthias Clasen [Tue, 14 Sep 2021 16:22:36 +0000 (12:22 -0400)]
Annotate gsk_ngl_uniform_state_align as pure
Matthias Clasen [Tue, 14 Sep 2021 16:21:34 +0000 (12:21 -0400)]
Annotate gsk_rounded_rect_is_circular as pure
And also mark gsk_rounded_rect_to_string as malloc.
Matthias Clasen [Tue, 14 Sep 2021 16:21:05 +0000 (12:21 -0400)]
Annotate pango_glyph_string_num_glyphs as pure
Matthias Clasen [Tue, 14 Sep 2021 16:19:13 +0000 (12:19 -0400)]
Annotate gdk_unichar_direction as const
Matthias Clasen [Tue, 14 Sep 2021 20:37:16 +0000 (20:37 +0000)]
Merge branch 'gsk-tests-gl' into 'master'
testsuite: Call g_test_init in test binaries
See merge request GNOME/gtk!3953
Matthias Clasen [Tue, 14 Sep 2021 20:11:42 +0000 (16:11 -0400)]
testsuite: Stop running tests for the gl renderer
It does not exist anymore.
Matthias Clasen [Tue, 14 Sep 2021 20:10:39 +0000 (16:10 -0400)]
testsuite: Call g_test_init in test binaries
Without it, we mess out on G_DEBUG=fatal-warnings,
so our ci does not alert us that we run a bunch of
tests which spit out warnings.
Matthias Clasen [Tue, 14 Sep 2021 13:29:28 +0000 (13:29 +0000)]
Merge branch 'fix_accessible_described_by' into 'master'
Fix generation of accessible description in presence of described by relations
See merge request GNOME/gtk!3948
Matthias Clasen [Tue, 14 Sep 2021 13:14:10 +0000 (13:14 +0000)]
Merge branch 'test-leak-fixes' into 'master'
testsuite: Fix a few memory leaks
See merge request GNOME/gtk!3947
Lukáš Tyrychtr [Tue, 14 Sep 2021 12:33:30 +0000 (14:33 +0200)]
Fix generation of accessible description in presence of described by relations
The loop going through the relation list should have stopped on the NULL sentinel value, however it never accesed the next list element.
Matthias Clasen [Tue, 14 Sep 2021 12:24:36 +0000 (08:24 -0400)]
testsuite: Fix a few memory leaks
These are keeping the asan build in ci from passing.
Matthias Clasen [Tue, 14 Sep 2021 12:27:39 +0000 (12:27 +0000)]
Merge branch 'tiff-ci' into 'master'
ci: Add libtiff-devel to the image
See merge request GNOME/gtk!3946
Matthias Clasen [Tue, 14 Sep 2021 12:05:09 +0000 (08:05 -0400)]
ci: Use the v4 image
Matthias Clasen [Tue, 14 Sep 2021 12:03:41 +0000 (08:03 -0400)]
ci: Add libtiff-devel to the image
We want to require libtiff in our build.
Matthias Clasen [Tue, 14 Sep 2021 11:36:25 +0000 (11:36 +0000)]
Merge branch 'wip/exalm/papercuts' into 'master'
Fix 2 papercuts
See merge request GNOME/gtk!3945
Alexander Mikhaylenko [Tue, 14 Sep 2021 07:23:03 +0000 (12:23 +0500)]
media-controls: Make play button flat
Match the volume button.
Alexander Mikhaylenko [Tue, 14 Sep 2021 07:22:45 +0000 (12:22 +0500)]
searchbar: Vertically center the close button
Matthias Clasen [Mon, 13 Sep 2021 16:10:37 +0000 (16:10 +0000)]
Merge branch 'fix_#4255' into 'master'
stack: Dispose children before emitting items-changed
Closes #4255
See merge request GNOME/gtk!3943
Julian Sparber [Mon, 13 Sep 2021 14:29:30 +0000 (16:29 +0200)]
stack: Dispose children before emitting items-changed
This makes sure that the `GListModel` returned by
`gtk_stack_get_pages()` actually has the items removed before
`items-changed` is emitted.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4255
Benjamin Otte [Mon, 13 Sep 2021 00:16:30 +0000 (00:16 +0000)]
Merge branch 'wip/otte/texture-threads' into 'master'
gltexture: Make sure downloading textures works in a different thread
See merge request GNOME/gtk!3942
Benjamin Otte [Sun, 12 Sep 2021 23:49:56 +0000 (01:49 +0200)]
ngl: Simplify and unbug texture download
If we can't handle the texture, always just download_texture() it,
that way we are sure it's a memory texture.
Benjamin Otte [Sun, 12 Sep 2021 22:19:35 +0000 (00:19 +0200)]
gltexture: Make sure downloading textures works in a different thread
This happens in the real world when using the inspector to look at a
node recording of a GStreamer video while the video is still playing.
GStreamer will use the GL context in a different thread while we are
busy trying to download it.
A test is included.
Philipp Kiemle [Sun, 12 Sep 2021 21:45:26 +0000 (21:45 +0000)]
Update German translation
(cherry picked from commit
17d828fda2137eaa068de947171214db8ec7b074)
Benjamin Otte [Sun, 12 Sep 2021 12:55:00 +0000 (12:55 +0000)]
Merge branch 'wip/otte/float-textures' into 'master'
Add float texture formats
See merge request GNOME/gtk!3940
Balázs Úr [Sun, 12 Sep 2021 06:03:58 +0000 (06:03 +0000)]
Update Hungarian translation
Benjamin Otte [Sun, 12 Sep 2021 02:34:42 +0000 (04:34 +0200)]
testsuite: Add tests for gdk_texture_download_float()
Benjamin Otte [Sat, 11 Sep 2021 22:11:44 +0000 (00:11 +0200)]
testsuite: Add memory test support for OpenGL up/downloads
Use a GL renderer to upload textures (and then optionally download them
via release() again). This way, we can test that the GL renderer
properly uploads textures to the right formats (not losing information
for HDR for example) and downloads them again.
Benjamin Otte [Sat, 11 Sep 2021 20:50:09 +0000 (22:50 +0200)]
testsuite: Add tests uploading the memorytextures
Use a GL renderer and render_texture() them.
Benjamin Otte [Sat, 11 Sep 2021 20:26:37 +0000 (22:26 +0200)]
testsuite: Rework memorytexture test some more
Instead of predefined colors, generate them randomly.
Benjamin Otte [Sat, 11 Sep 2021 19:19:48 +0000 (21:19 +0200)]
testsuite: Overhaul memorytexture test
Instead of hardcoding pixel values, allow construction of textures by
filling them with GdkRGBA values.
Benjamin Otte [Sun, 12 Sep 2021 03:04:32 +0000 (05:04 +0200)]
gl: Implement uploading and downloading HDR formats
Also refactor the GL uploading so it does the fallback in a
GLES-compatible way, which means we only need one fallback.
Benjamin Otte [Sat, 11 Sep 2021 19:18:56 +0000 (21:18 +0200)]
memorytexture: Add support for HDR formats
Also sanitize the input bytes so the strides match alignment
requirements of the data types.
Benjamin Otte [Fri, 10 Sep 2021 00:40:21 +0000 (02:40 +0200)]
texture: Add gdk_texture_download_float()
Benjamin Otte [Sat, 11 Sep 2021 22:10:10 +0000 (00:10 +0200)]
gdk: Deprecate gdk_cairo_draw_from_gl()
It's broken with various pixel formats and OpenGL ES, it's hard to
understand what everything does, and gdk_texture_download() can be used
instead.
Benjamin Otte [Sat, 11 Sep 2021 22:14:19 +0000 (00:14 +0200)]
gltexture: Implement download() via glGetTexImage()
1. The download via gdk_cairo_draw_from_gl() was broken sometimes
2. We get easy conversion on fallback by chaining up and using
download_texture().
3. One more place where Cairo is no longer necessary.
Benjamin Otte [Sun, 12 Sep 2021 03:11:58 +0000 (05:11 +0200)]
gltexture: Make release() use download_texture()
1. It avoids Cairo, and in particular conversion to Cairo.
2. Keeping a texture allows easy chaining in the vfuncs.
3. Using a texture means releasing will work for HDR formats
too, once we add them.
Benjamin Otte [Sun, 12 Sep 2021 02:42:24 +0000 (04:42 +0200)]
texture: Add gdk_texture_download_texture()
A private vfunc that downloads a texture as a GdkMemoryTexture in
whatever format the texture deems best.
There are multiple reasons for this:
* GLES cannot download the Cairo format. But it can download some
format and then just delegate to the GdkMemoryTexture implementation.
* All the other download vfuncs (including the ones still coming) can
be implemented via download_texture() and delegation, making the
interface easier.
* We want to implement image loading and saving support. By using
download_texture(), we can save in the actual format of the texture.
* A potential GdkCompressedTexture could be implemented by just
providing this one vfunc as a compress() step.
Benjamin Otte [Thu, 9 Sep 2021 00:05:08 +0000 (02:05 +0200)]
texture: Add GdkMemoryConversion private enum
Now gdk_memory_convert() converts to one of these conversions instead of
re(ab)using parts of the GdkMemoryFormat enum.
Benjamin Otte [Sat, 11 Sep 2021 22:09:11 +0000 (00:09 +0200)]
gltexture: release() to a texture, not a cairo_surface
This makes forwarding vfuncs a lot easier, because we can just call them
on the texture.
Benjamin Otte [Wed, 8 Sep 2021 18:46:25 +0000 (20:46 +0200)]
texture: Remove unused argument from vfunc
Balázs Úr [Sat, 11 Sep 2021 23:45:21 +0000 (23:45 +0000)]
Update Hungarian translation
Benjamin Otte [Sat, 11 Sep 2021 20:56:39 +0000 (20:56 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
rendernode: Write the whole node
See merge request GNOME/gtk!3938
Benjamin Otte [Sat, 11 Sep 2021 04:06:02 +0000 (06:06 +0200)]
rendernode: Write the whole node
It turns out g_output_stream_write_bytes() does not write the bytes.
It should be renamed to g_output_stream_write_some_of_the_bytes() maybe.
Benjamin Otte [Sat, 11 Sep 2021 12:57:25 +0000 (12:57 +0000)]
Merge branch 'hsl' into 'master'
gdk_rgba_parse: Support HSL colors
See merge request GNOME/gtk!3899
Guillaume Bernard [Sat, 11 Sep 2021 09:41:11 +0000 (09:41 +0000)]
Update French translation
(cherry picked from commit
8ffd7e9f87cfd3ce51c6b4b7a91bfe40670c89bb)
Guillaume Bernard [Sat, 11 Sep 2021 09:36:29 +0000 (09:36 +0000)]
Update French translation
(cherry picked from commit
f433c543fe7a11953362f09274f9e29d088815f9)
Matthias Clasen [Sat, 11 Sep 2021 02:53:43 +0000 (02:53 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Stop using config.h.meson
See merge request GNOME/gtk!3936
Matthias Clasen [Wed, 8 Sep 2021 23:50:09 +0000 (19:50 -0400)]
Refactor gdk_gl_context_upload_texture slightly
Introduce a gl_internalformat variable. This will
let us handle more formats in a uniform way in
future commits.
Matthias Clasen [Fri, 10 Sep 2021 11:46:24 +0000 (07:46 -0400)]
Add vectorized half-float conversion
We can't make the -4 versions inline, since
we use ifuncs for them, so make vectorized
versions.
Test included.
Matthias Clasen [Sat, 11 Sep 2021 00:51:11 +0000 (20:51 -0400)]
Stop using config.h.meson
It isn't necessary and makes us miss defines when
we forget to update it.
James Westman [Sun, 29 Aug 2021 02:08:47 +0000 (21:08 -0500)]
gdk_rgba_parse: Support HSL colors
Philipp Kiemle [Fri, 10 Sep 2021 19:55:29 +0000 (19:55 +0000)]
Update German translation
(cherry picked from commit
6228954524cfe153b20673f356a26eaba9f9e846)
Matthias Clasen [Fri, 10 Sep 2021 13:54:37 +0000 (13:54 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Fix the testupload test
See merge request GNOME/gtk!3934
Matthias Clasen [Fri, 10 Sep 2021 12:05:29 +0000 (08:05 -0400)]
Fix the testupload test
This can only ever have worked by accident.
Emin Tufan Çetin [Fri, 10 Sep 2021 06:40:43 +0000 (06:40 +0000)]
Update Turkish translation
Anders Jonsson [Wed, 8 Sep 2021 20:25:27 +0000 (20:25 +0000)]
Update Swedish translation
Boyuan Yang [Sun, 5 Sep 2021 20:33:21 +0000 (20:33 +0000)]
Update Chinese (China) translation
Daniel Șerbănescu [Sun, 5 Sep 2021 18:43:29 +0000 (18:43 +0000)]
Update Romanian translation
(cherry picked from commit
bb72acf9cd341ca30c55a0392c842e955b42e58d)
Daniel Șerbănescu [Sun, 5 Sep 2021 18:34:20 +0000 (18:34 +0000)]
Update Romanian translation
(cherry picked from commit
63d829bbc182bb06fe28a2e649f50360bc4442b8)
Matthias Clasen [Sun, 5 Sep 2021 17:26:13 +0000 (17:26 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
inspector: Cosmetics
See merge request GNOME/gtk!3925
Matthias Clasen [Sun, 5 Sep 2021 16:59:11 +0000 (12:59 -0400)]
inspector: Cosmetics
Make some settings entries smaller, and make the
scales match in size. Also, inline adjustments
in the ui file, since we can do that now.
Matthias Clasen [Sun, 5 Sep 2021 16:12:34 +0000 (16:12 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Avoid hand-rolled color glyph information
See merge request GNOME/gtk!3924
Matthias Clasen [Sat, 4 Sep 2021 13:41:20 +0000 (09:41 -0400)]
Bump pango req to 1.49.1
We are using pango api that was introduced in 1.49.1
without ifdefs, so we should require it.